<?php

/**
 * login form
 *
 * @author    Mon Zafra <monzee at gmail>
 * @copyright (c)2009 Mon Zafra
 * @license   http://monzee.wordpress.com/license New BSD
 * @version   $Id: LoginForm.php 38 2009-02-18 17:12:39Z monzee $
 */
class User_LoginForm extends Zend_Form
{
    public function init()
    {
        $formDecors = array(
            'FormElements', array('HtmlTag', array('tag' => 'ul', 'class' => 'list-form')),
            'Form'
        );
        $elementLi = array(
            'ViewHelper', 'Label', 'Errors',
            array('HtmlTag', array('tag' => 'li'))
        );
        $elementBasic = array('ViewHelper');
        $groupDecors = array('FormElements', array(
            'HtmlTag',
            array('tag' => 'li', 'class' => 'actions'))
        );

        $this->setAttrib('id', 'login')
            ->setMethod('post')
            ->setDecorators($formDecors)
            ->addElement('text', 'username',
                array('label' => 'Username', 'required' => true, 'class' => 'text', 'decorators' => $elementLi))
            ->addElement('password', 'password',
                array('label' => 'Password:', 'required' => true, 'class' => 'text', 'decorators' => $elementLi))
            ->addElement('submit', 'submit', 
                array('label' => 'Login', 'class' => 'button', 'decorators' => $elementBasic))
            ->addDisplayGroup(array('submit'), 'actions', array('decorators' => $groupDecors))
        ;

    }

}
